<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "tau_roleinfo".
 *
 * @property integer $ID
 * @property string $RoleName
 * @property integer $SortID
 * @property integer $State
 *
 * @property TauOperinfo[] $tauOperinfos
 */
class TauRoleinfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'tau_roleinfo';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['SortID', 'State'], 'integer'],
            [['RoleName'], 'string', 'max' => 20]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'RoleName' => 'Role Name',
            'SortID' => 'Sort ID',
            'State' => 'State',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTauOperinfos()
    {
        return $this->hasMany(TauOperinfo::className(), ['TAu_ID' => 'ID', 'RoleName' => 'RoleName']);
    }
}
